<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 frontpage.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.1
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
include $root_path.'common.php';
$page_title = $lang['frontpage'];
include $root_path.'page_header.php';

$unsorted_junk = <<<EOFpacman
<cpanel Frontpage="listtable()">
EOFpacman;

$frontpage = explode('</tr>', $unsorted_junk);
$array_of_frontpage = array();

$i = 0;
foreach ($frontpage as $row) {
	$temp = explode('<td>', $row);
	$temp2 = explode('</td>', $temp[1]);
	$array_of_frontpage[$i]['domain'] = trim($temp2[0]);

	$temp = explode('<font color="#FF0000">', $row);
	$temp2 = explode('</td>', $temp[1]);
	$array_of_frontpage[$i]['status'] = trim($temp2[0]);

	if ($array_of_frontpage[$i]['domain'] != '') {
		$template->assign_block_vars('frontpagerow', array(
			'ROWCLASS' => ($i%2) ? $template_cfg['class_row_1'] : $template_cfg['class_row_2'],
			'DOMAIN' => $array_of_frontpage[$i]['domain'],
			'STATUS' => $array_of_frontpage[$i]['status'],
			'U_INSTALL' => 'frontpage_install_done.php?pdomain='.$array_of_frontpage[$i]['domain'],
			'U_UNINSTALL' => 'frontpage_uninstall_done.php?pdomain='.$array_of_frontpage[$i]['domain'],
			)
		);
	};
	
	if ($array_of_frontpage[$i]['status'] == "not installed") {
		$template->assign_block_vars('frontpagerow.switch_not_installed', array());
	} else if ($array_of_frontpage[$i]['status'] == "installed") {
		$template->assign_block_vars('frontpagerow.switch_installed', array());
	};
	
	$i++;
};



$template->set_filenames(array(
	'body' => $root_path.$template_path.'server/frontpage.tpl')
);

$template->assign_vars(array(
	'CURRENT_EMAIL' => '<cpanel CustInfo="getemail()">',
	'S_ACTION' => 'pro_support_request_done.php',
	
	'L_FRONTPAGE' => $lang['frontpage'],
	'L_FRONTPAGE_INTRO' => $lang['frontpage_intro'],
	'L_DOMAIN' => $lang['domain'],
	'L_STATUS' => $lang['status'],
	'L_ACTIONS' => $lang['actions'],
	
	'L_INSTALL' => $lang['install'],
	'L_UNINSTALL' => $lang['uninstall'],
	
));

//
// Woohoo! All done!
//
$template->pparse('body');


include $root_path.'page_tail.php';




?>